#pragma once
#include "Video.h"
#include "ShaderVariable.h"
#include "ShaderResource.h"

using namespace System::Runtime::InteropServices;

namespace Reign
{namespace Video
{namespace D3D10
{
	public ref class ShaderModel abstract : Disposable
	{
		#pragma region Properties
		protected: Video^ video;
		internal: ID3D10Blob* code;
		protected: ID3D10Buffer* variableBuffer;
		private: uint variableBufferBytesCount;
		private: ID3D10ShaderReflection* reflection;
		private: ID3D10ShaderReflectionConstantBuffer* variables;

		private: char* variableBufferBytes;
		public: property char* VariableBufferBytes {char* get();}

		protected: ID3D10ShaderResourceView** resources;
		protected: uint resourcesCount, resourcesKnownCount;
		public: property ID3D10ShaderResourceView** Resources {ID3D10ShaderResourceView** get();}
		#pragma endregion

		#pragma region Constructors
		public: ShaderModel(ShaderI^ shader, string^ code, ShaderVersions shaderVersion, ShaderTypes shaderType);
		public: ~ShaderModel();
		private: void null();
		#pragma endregion

		#pragma region Methods
		public: virtual void Apply();
		public: int Variable(string^ name);
		public: int Resource(string^ name);
		#pragma endregion
	};
}
}
}